#include "DeleteSheetCommand.h"
#include "FrakOutController.h"

DeleteSheetCommand::DeleteSheetCommand(const QString& text,
                                       FrakOutController& controller,
                                       const FrakOutDataItem& sheet,
                                       int sheetIndex) :
QUndoCommand(text), m_controller(controller), m_sheet(sheet), m_sheetIndex(sheetIndex)
{
}

void DeleteSheetCommand::redo()
{
    m_controller.deleteSheet(m_sheetIndex);
}

void DeleteSheetCommand::undo()
{
    m_controller.addSheet(m_sheetIndex, m_sheet);
}
